﻿@page "/PageGo"


@using SubstrateHelper.Data
@using SubstrateHelper.Models
@using Microsoft.AspNetCore.Mvc;
@using SubstrateHelper.Services;
@using Microsoft.EntityFrameworkCore;


@inject Microsoft.AspNetCore.Components.NavigationManager NavigationManager


@using TinyMessenger;
@*@inject NCDbContext Db;*@
@inject SubstrateHelper.Data.SubstrateHelperDbContext Db;





<AuthorizeView>
    <Authorized>





    </Authorized>
    <NotAuthorized>
        <div>您未登录！请<a href="Identity/Account/Login">登录</a>后进行操作。</div>
    </NotAuthorized>
</AuthorizeView>
@code{

    protected override async Task OnInitializedAsync()
    {




        try
        {

            //var pick = Helpers.OracleDbHelper.GetData<ProcessBase.Models.V_MES_HX_PICK>("select * from V_MES_HX_PICK");
            //var mo = Helpers.OracleDbHelper.GetData<ProcessBase.Models.V_MES_HX_MO>("select * from V_MES_HX_MO");
            //var b = Helpers.OracleDbHelper.GetData<ProcessBase.Models.V_MES_HX_PICK_B>("select * from V_MES_HX_PICK_B");

            //var helper = new Helpers.DataToExcelHelper();
            //helper.AddSheetData(mo);
            //helper.AddSheetData(pick);
            //helper.AddSheetData(b);
            //var error=helper.DataToExcel("e:\\temp\\NC.xlxs");

            //Helpers.OracleDbHelper.SaveDataToExcel("select * from v_mes_hx_mo",@"e:\temp\v_mes_hx_mo.csv");
            //Helpers.OracleDbHelper.SaveDataToExcel("select * from v_mes_hx_pick", @"e:\temp\v_mes_hx_pick.csv");
            //Helpers.OracleDbHelper.SaveDataToExcel("select * from v_mes_hx_pick_b", @"e:\temp\v_mes_hx_pick_b.csv");
            //Helpers.OracleDbHelper.SaveDataToExcel("select * from v_mes_hx_mo_h", @"e:\temp\v_mes_hx_mo_h.csv");
            //Helpers.OracleDbHelper.SaveDataToExcel("select * from v_mes_hx_mo_b", @"e:\temp\v_mes_hx_mo_b.csv");V_MES_HX_WR
            //Helpers.OracleDbHelper.SaveDataToExcel("select * from V_MES_HX_WR", @"e:\temp\V_MES_HX_WR.csv");

            //var templatePath = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Templates\\XmlModifyTemplate.xlsx");
            //var xmlPath = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Templates\\完工报告.xml");

            //var templatesWG = ExcelHelper.ExcelToData.GetData<ProcessBase.Models.XmlModifyTemplate>(templatePath, "完工报告", "备注");

            //var order = Db.Orders.FirstOrDefault();

            //var inputValue = new ProcessBase.Models.WanGongBaoGaoValue()
            //{
            //    id = "手动：表单ID",//	
            //    dbilldate = "手动：报产日期",//	
            //    dmakedate = "手动：制单日期",//	
            //    creationtime = "手动：创建时间",//	
            //    vbrowno = "手动：行号",//	
            //    tbstarttime = "手动：开始时间",//	
            //    tbendtime = "手动：结束时间",//	
            //    vbinbatchcode = "手动：入库批次号",//	
            //    nbwrnum = "手动完工主数量：",//	
            //    nbwrastnum = "手动：完工数量",//	
            //    vbnote = "手动：行备注",//	
            //};
            //var xml = Helpers.XmlHelper.ModifyXml(xmlPath, templatesWG, order, inputValue);
            //var templatesRK = ExcelHelper.ExcelToData.GetData<ProcessBase.Models.XmlModifyTemplate>(templatePath, "入库单", "备注");

            var order = Db.Orders.FirstOrDefault();
            await Helpers.NCHelper.RuKu(order, "HD2005003", 40, new DateTime(2021, 5, 4));
            await Helpers.NCHelper.RuKu(order, "HD2005004", 40, new DateTime(2021, 5, 4));

        }
        catch (Exception ex)
        {

        }

    }
}
